package com.jvyou.framework.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jvyou.common.core.domain.model.PageResult;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import com.jvyou.framework.domain.entity.OperLog;
import com.jvyou.framework.service.OperLogService;
import com.jvyou.framework.mapper.OperLogMapper;
import com.jvyou.framework.domain.dto.OperLogDto;

/**
 * 操作日志记录(OperLog)表服务实现类
 *
 * @author 橘柚
 * @since 2025-05-29 14:41:24
 */
@RequiredArgsConstructor
@Service("operLogService")
public class OperLogServiceImpl extends ServiceImpl<OperLogMapper, OperLog> implements OperLogService {

    /**
     * 构建查询条件包装器
     * @param dto 查询参数
     * @return QueryWrapper
     */
    private QueryWrapper<OperLog> getWrapper(OperLogDto dto) {
        QueryWrapper<OperLog> ew = new QueryWrapper<>();
        return ew;
    }

    @Override
    public List<OperLog> listOperLog(OperLogDto dto) {
        return list(getWrapper(dto));
    }

    @Override
    public PageResult<OperLog> pageOperLog(OperLogDto dto) {
        IPage<OperLog> page = new Page<>(dto.getCurrent(), dto.getPageSize());
        page = page(page, getWrapper(dto));
        return PageResult.success(page);
    }

}
